package com.du.cloud.common.base.constant;

public interface SecurityConstants {
    // 角色前缀
    String ROLE_PREFIX = "ROLE_";

    // 默认登录URL
    String OAUTH_TOKEN_URL = "/oauth/token";

    // grant_type
    String REFRESH_TOKEN = "refresh_token";

    // {bcrypt} 加密的特征码
    String BCRYPT = "{bcrypt}";

    // sys_oauth_client_details 表的字段
    String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
            + "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
            + "refresh_token_validity, additional_information, autoapprove";

    // JdbcClientDetailsService 查询语句
    String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS
            + " from sys_oauth_client_details";

    // 默认的查询语句
    String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";

    // 按条件client_id 查询
    String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

    // 用户ID字段
    String DETAILS_USER_ID = "user_id";
    // 用户名字段
    String DETAILS_USERNAME = "username";
    // 手机号
    String DETAILS_PHONE = "phone";

    /**
     * 内部服务调用
     */
    String FROM_IN = "inner";
    String FROM = "From";
}
